package com.hxalex.simulationhandle.accessbilityService.command.wifi;

import android.view.accessibility.AccessibilityNodeInfo;

import com.hxalex.simulationhandle.accessbilityService.command.base.BaseCommand;
import com.hxalex.simulationhandle.accessbilityService.manger.WifiManger;
import com.hxalex.simulationhandle.accessbilityService.receiver.base.BaseReceiver;
import com.hxalex.simulationhandle.accessbilityService.receiver.wifi.CheckWifiIsConnectReceiver;

/**
 * Created by hx_Alex on 2018/5/29.
 */

public class CheckWifiIsConnectCommand extends BaseCommand {
    private AccessibilityNodeInfo nodeInfo;
    
    public CheckWifiIsConnectCommand(WifiManger wifiManger, BaseReceiver receiver) {
        super(wifiManger, receiver);
    }

    public AccessibilityNodeInfo getNodeInfo() {
        return nodeInfo;
    }

    public void setNodeInfo(AccessibilityNodeInfo nodeInfo) {
        this.nodeInfo = nodeInfo;
    }

    @Override
    public void execute() {
      
        if(receiver instanceof CheckWifiIsConnectReceiver)
        {
       
            ((CheckWifiIsConnectReceiver)receiver).setInfo(nodeInfo);
            receiver.doSomething();
        }
    }
}
